package java6;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n =in.nextInt();
		double[] arr = new double[n];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = in.nextDouble();
		}
		System.out.println(ArrayUtils.findMinMax(arr));
		System.out.println(ArrayUtils.PairResult.class);

	}
	

}
class ArrayUtils  {
	public static class PairResult{
		private double min;
		private double max;
		public PairResult(double min, double max) {
			super();
			this.min = min;
			this.max = max;
		}
		
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}

		public double getMin() {
			return min;
		}
		public void setMin(double min) {
			this.min = min;
		}
		public double getMax() {
			return max;
		}
		public void setMax(double max) {
			this.max = max;
		}
		
	}
	static PairResult findMinMax(double[] values) {
		double min = values[0];
		double max = values[0];
		for (int i = 0; i < values.length; i++) {
			if(values[i] < min) {
				min = values[i];
			}
			if(values[i] > max) {
				max = values[i];
			}
		}
		PairResult result = new PairResult(max, min);
		result.max = max;
		result.min = min;
			return result;
		}
}